import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import utils from './utils'
// import VConsole from 'vconsole/dist/vconsole.min.js'


// eslint-disable-next-line no-unused-vars
// const vConsole = new VConsole();
// 或者使用配置参数来初始化，详情见文档
// console.log(vConsole)
// import 'amfe-flexible'
//初始化样式
import './common/stylus/index.styl'
Vue.config.productionTip = false
Vue.use(utils)
import { Button } from 'vant';
import { Tab, Tabs, Icon, Popup, Dialog, Form, Field, Toast, PullRefresh, Search, List, Loading, Overlay} from 'vant';
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Button)
Vue.use(Icon)
Vue.use(Popup)
Vue.use(Dialog)
Vue.use(Form)
Vue.use(Field)
Vue.use(Toast)
Vue.use(Search)
Vue.use(List)
Vue.use(PullRefresh)
Vue.use(Loading)
Vue.use(Overlay)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


function setHtmlSize(){
var pageWidth = window.innerWidth;
if(typeof pageWidth != "number"){ 
    if(document.compatMode == "number"){ 
      pageWidth = document.documentElement.clientWidth;
    }else{ 
      pageWidth = document.body.clientWidth; 
    } 
} 
var fontSize = (window.innerWidth * 100) / 750;
if(fontSize < 40 ){
    fontSize = 40;
}
//根据屏幕大小确定根节点字号
    document.getElementsByTagName('html')[0].style.fontSize = '39px' || fontSize + 'px';
}
function resize(){
    setHtmlSize();
}
if (window.attachEvent) { 
    window.attachEvent("resize", resize); 
} else if (window.addEventListener) { 
  window.addEventListener("resize", resize, false);   
}
setHtmlSize();